//
//  QMQCIllnessViewController.m
//  QcMedical1
//
//  Created by 仲启明 on 2016/12/21.
//  Copyright © 2016年 jiawen Du. All rights reserved.
//

#import "QMQCIllnessViewController.h"
#import "QMQCIllnessDetailController.h"
#import "QMQCComplicationController.h"
#import "QMQCCureTypeController.h"
#import "NetWorkTool.h"
#import "QMQCDocCountModel.h"
#import "DoctorApplyController.h"
@interface QMQCIllnessViewController ()


/**
    匹配到的医生数
 */
@property (weak, nonatomic) IBOutlet UILabel *lb_docCount;

/**
 从未接受过治疗的按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *btn_didCured;

/**
 接受过治疗的按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *btn_isCured;

/**
 已确诊的按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *btn_isSure;

/**
 疑似症状按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *btn_isLike;

/**
 选择治疗方式的View
 */
@property (weak, nonatomic) IBOutlet UIView *cureView;

@property (nonatomic, strong)NSArray<QMQCDocCountModel *> *docCountModel;

/**
 选择疾病细分的按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *btn_detailIll;

/**
 选择并发症的按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *btn_effectIll;

/**
 是否确诊的背景按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *btn_isSureIll;

/**
 是否接受过治疗的背景按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *btn_isCureIll;

/**
 选择治疗方式的文本框
 */
@property (weak, nonatomic) IBOutlet UITextField *tf_typeOfIll;

/**
 申请医生
 */
@property (weak, nonatomic) IBOutlet UIButton *btn_apply;


@property (nonatomic, strong) NSMutableArray *mArray;
@end

@implementation QMQCIllnessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.reason.text = [NSString stringWithFormat:@"疾病信息:%@",self.name];
    
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];
    
    
    titleLabel.textAlignment = NSTextAlignmentCenter;
    
    
    titleLabel.text = self.name;
    
    titleLabel.font = [UIFont fontWithName:@"CloudShuiZhuGBK" size:18];
    self.navigationItem.titleView = titleLabel;
    
    self.view.backgroundColor = [UIColor colorWithRed:230/255.0 green:230/255.0 blue:238/255.0 alpha:1];
    
    self.btn_detailIll.titleLabel.font = [UIFont fontWithName:@"CloudShuiZhuGBK" size:15];
    
    self.btn_effectIll.titleLabel.font = [UIFont fontWithName:@"CloudShuiZhuGBK" size:15];
    self.btn_isCureIll.titleLabel.font = [UIFont fontWithName:@"CloudShuiZhuGBK" size:15];
    
    self.btn_isSureIll.titleLabel.font = [UIFont fontWithName:@"CloudShuiZhuGBK" size:15];
    
    self.tf_typeOfIll.font = [UIFont fontWithName:@"CloudShuiZhuGBK" size:15];
    self.btn_apply.titleLabel.font = [UIFont fontWithName:@"CloudShuiZhuGBK" size:15];
}

- (IBAction)searchDoc:(id)sender {
    
  
    self.lb_docCount.text = @"为您匹配到: 24位专家";
    
    DoctorApplyController *vc = [[DoctorApplyController alloc] init];
    
    [self.navigationController pushViewController:vc animated:YES];
}


- (IBAction)click_illnesCompare:(id)sender {
    
    QMQCIllnessDetailController *vc = [[QMQCIllnessDetailController alloc] init];
    vc.detailBlock = ^(NSString *detailName){
      
        [self.btn_detailIll setTitle:detailName forState:UIControlStateNormal];
        [self.btn_detailIll setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    };
    vc.detailCellID = self.cellID;
    
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)click_illnessEffect:(id)sender {
    
    QMQCComplicationController *vc = [[QMQCComplicationController alloc] init];
    vc.DiseaseSubDivisionBlock = ^(NSString *DiseaseSubDivisionString,NSMutableArray *array){
        
        
        [self.btn_effectIll setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        
        [self.btn_effectIll setTitle:DiseaseSubDivisionString forState:UIControlStateNormal];
        //cell.lb_num.text = [NSString stringWithFormat:@"共%zd个",array.count];
        
        vc.mArray = self.mArray;

    };

    
    [self.navigationController pushViewController:vc animated:YES];
}

- (IBAction)click_didCured:(id)sender {
    
    [self.btn_didCured setSelected:YES];
    [self.btn_isCured setSelected:NO];
    
    self.cureView.hidden = YES;
}

- (IBAction)click_curePath:(id)sender {
    
    QMQCCureTypeController *cure = [[QMQCCureTypeController alloc] init];
    
    cure.cureType = ^(NSString *cureTypeText){
        
        self.tf_typeOfIll.text = cureTypeText;
    };
    
    [self.navigationController pushViewController:cure animated:YES];
}

- (IBAction)click_isLike:(id)sender {
    
    [self.btn_isLike setSelected:YES];
    
    [self.btn_isSure setSelected:NO];
}
- (IBAction)click_isSure:(id)sender {
    
    [self.btn_isSure setSelected:YES];
    
    [self.btn_isLike setSelected:NO];
}
- (IBAction)click_iscured:(id)sender {
   
    [self.btn_isCured setSelected:YES];
    
    [self.btn_didCured setSelected:NO];
    
    self.cureView.hidden = NO;
}

@end
